//##################################
//javascript 判断IE判断是否是IE

if (navigator.userAgent.indexOf("MSIE") >= 0) {

    }
    else{

    }
//判断是否是ie6
//!window.XMLHttpRequest


if(window.ActiveXObject)
    alert("is IE")
else
    alert("not's IE")

//2##################################
//返回IE的版本信息
function getInternetExplorerVersion()
{
var rv = -1; // Return value assumes failure
if (navigator.appName == 'Microsoft Internet Explorer')
{
    var ua = navigator.userAgent;
    var re  = new RegExp('MSIE ([0-9]{1,}[.0-9]{0,})');
    if (re.exec(ua) != null)
        rv = parseFloat( RegExp.$1 );
}
return rv;
}

//2##################################
//prototype 的onload事件
  Event.observe(window, 'load', function() {
    if($('flash_work')){
      setTimeout(Effect.BlindUp('flash_work', {duration: 1}) ,5000);}

  });
 Effect.BlindUp('edit', {duration: 3});
new Effect['BlindUp']('edit', {duration: 1});
new Effect[Element.visible('new_work') ? 'BlindUp' : 'BlindDown']('new_work', {duration: 1});


// js对文字进行编码涉及3个函数：
// escape,encodeURI,encodeURIComponent，
// 相应3个解码函数：unescape,decodeURI,decodeURIComponent


// fck 取得副文本框
//   FCKeditorAPI.GetInstance('email__body_editor').GetXHTML()

function add_edit_val(val_name,email_id){
  var oEditor = FCKeditorAPI.GetInstance('email_'+email_id+'_body_editor') ;
	if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
	{
		if(val_name == 'user'){
	  	oEditor.InsertHtml("<$ user_name $>")
	  }else if(val_name == 'email'){
	    oEditor.InsertHtml("<$ email $>")
	  }else if(val_name == 'address'){
	    oEditor.InsertHtml("<$ address $>")
	  }else if(val_name == 'phone_number'){
	    oEditor.InsertHtml("<$ phone_number $>")
	  }else if(val_name == 'language'){
	    oEditor.InsertHtml("<$ language $>")
	  }else if(val_name == 'zipcode'){
	    oEditor.InsertHtml("<$ zip_code $>")
	  }else if(val_name == 'active'){
	    oEditor.InsertHtml("<$ active $>")
	  }
	}
	else{
	   alert('You must be on WYSIWYG mode!') ;
	}
}